/*
 * basic_rx_tx_tc.c
 *
 *  Created on: Jun 25, 2012
 *      Author: Tiberiu S. Petre
 */

#ifndef _pre_proc_test_h
#define _pre_proc_test_h
int basic_rx_tx_test() {

	pcm_frame_t in_pcm_frame;
	pcm_frame_t out_pcm_frame;
	unpacked_hf uhf;
	int i, k;
	for (k = 0; k < 200; k++) {
		printf("Generating random samples...\n");
		// Generate random samples
		for (i = 0; i < 160; i++) {
			in_pcm_frame[i] = rand();
			in_pcm_frame[i] >>= 3;
			in_pcm_frame[i] <<= 3;
		}
		printf("Creating unpacked homing frame...\n");
		create_unpacked_hf(uhf);

		printf("Encoding samples...\n");
		rpe_ltp_encode(in_pcm_frame, uhf);

		printf("Decoding homing frame...\n");
		rpe_ltp_decode(uhf, out_pcm_frame);

		printf("Destroying unpacked homing frame...\n");
		destroy_unpacked_hf(uhf);
	}

	return 0;
}

#endif
